/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

//package br.com.krossk.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Henrique
 */
/*@Entity
@Table(name = "repositorio", catalog = "kross_knowledge_bd", schema = "")
@NamedQueries({
    @NamedQuery(name = "Repositorio.findAll", query = "SELECT r FROM Repositorio r"),
    @NamedQuery(name = "Repositorio.findByIdArquivoFK", query = "SELECT r FROM Repositorio r WHERE r.idArquivoFK = :idArquivoFK")})
public class Repositorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idArquivoFK")
    private Integer idArquivoFK;
    @Basic(optional = false)
    @Lob
    @Column(name = "conteudo")
    private byte[] conteudo;
    @JoinColumn(name = "idArquivoFK", referencedColumnName = "idArquivo", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Arquivo arquivo;

    public Repositorio() {
    }

    public Repositorio(Integer idArquivoFK) {
        this.idArquivoFK = idArquivoFK;
    }

    public Repositorio(Integer idArquivoFK, byte[] conteudo) {
        this.idArquivoFK = idArquivoFK;
        this.conteudo = conteudo;
    }
    
    public Integer getIdArquivoFK() {
        return idArquivoFK;
    }

    public void setIdArquivoFK(Integer idArquivoFK) {
        this.idArquivoFK = idArquivoFK;
    }

    public byte[] getConteudo() {
        return conteudo;
    }

    public void setConteudo(byte[] conteudo) {
        this.conteudo = conteudo;
    }

    public Arquivo getArquivo() {
        return arquivo;
    }

    public void setArquivo(Arquivo arquivo) {
        this.arquivo = arquivo;
        this.idArquivoFK = arquivo.getIdArquivo();
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idArquivoFK != null ? idArquivoFK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Repositorio)) {
            return false;
        }
        Repositorio other = (Repositorio) object;
        if ((this.idArquivoFK == null && other.idArquivoFK != null) || (this.idArquivoFK != null && !this.idArquivoFK.equals(other.idArquivoFK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.krossk.model.Repositorio[idArquivoFK=" + idArquivoFK + "]";
    }

}
*/